const { sequelize, DataTypes } = require('../../utill/getSequelize')

//开头表
const Beginning = sequelize.define('Beginning', {
  id: {
    type: DataTypes.INTEGER,
    primaryKey: true,
    autoIncrement: true,
  },

  code: {//课程编码
    type: DataTypes.STRING,
  },

  majors: {//适用专业
    type: DataTypes.STRING,
    // allowNull: false,
  },

  Leader: {//负责人
    type: DataTypes.STRING,
    // allowNull: false,
  },

  Reviewers: {//审核人
    type: DataTypes.STRING,
    // allowNull: false,
  },

  unit: {// 编制单位
    type: DataTypes.STRING,
    // allowNull: false,
  },

  make_time: {//编制时间
    type: DataTypes.STRING,
    // allowNull: false,
  },


  t_user_and_a_c_s_id: {
    type: DataTypes.INTEGER,
    allowNull: false,
  },


});


//同步模型和数据库表
(async () => {
  try {
    await sequelize.sync({ force: false });
    console.log('All models were synchronized successfully.');
  } catch (error) {
    console.log(error);
  }

})();

//提供出去
module.exports = { Beginning };